package com.ruoyi.hospital.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.hospital.domain.YlMedicalItems;
import com.ruoyi.hospital.mapper.YlMedicalItemsMapper;
import com.ruoyi.hospital.service.IYlMedicalItemsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 体检项目信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-16
 */
@Service
public class YlMedicalItemsServiceImpl implements IYlMedicalItemsService
{
    @Autowired
    private YlMedicalItemsMapper ylMedicalItemsMapper;

    /**
     * 查询体检项目信息
     * 
     * @param medicalItemsId 体检项目信息主键
     * @return 体检项目信息
     */
    @Override
    public YlMedicalItems selectYlMedicalItemsByMedicalItemsId(Long medicalItemsId)
    {
        return ylMedicalItemsMapper.selectYlMedicalItemsByMedicalItemsId(medicalItemsId);
    }

    /**
     * 查询体检项目信息列表
     * 
     * @param ylMedicalItems 体检项目信息
     * @return 体检项目信息
     */
    @Override
    public List<YlMedicalItems> selectYlMedicalItemsList(YlMedicalItems ylMedicalItems)
    {
        return ylMedicalItemsMapper.selectYlMedicalItemsList(ylMedicalItems);
    }

    /**
     * 新增体检项目信息
     * 
     * @param ylMedicalItems 体检项目信息
     * @return 结果
     */
    @Override
    public int insertYlMedicalItems(YlMedicalItems ylMedicalItems)
    {
        ylMedicalItems.setCreateTime(DateUtils.getNowDate());
        return ylMedicalItemsMapper.insertYlMedicalItems(ylMedicalItems);
    }

    /**
     * 修改体检项目信息
     * 
     * @param ylMedicalItems 体检项目信息
     * @return 结果
     */
    @Override
    public int updateYlMedicalItems(YlMedicalItems ylMedicalItems)
    {
        ylMedicalItems.setUpdateTime(DateUtils.getNowDate());
        return ylMedicalItemsMapper.updateYlMedicalItems(ylMedicalItems);
    }

    /**
     * 批量删除体检项目信息
     * 
     * @param medicalItemsIds 需要删除的体检项目信息主键
     * @return 结果
     */
    @Override
    public int deleteYlMedicalItemsByMedicalItemsIds(Long[] medicalItemsIds)
    {
        return ylMedicalItemsMapper.deleteYlMedicalItemsByMedicalItemsIds(medicalItemsIds);
    }

    /**
     * 删除体检项目信息信息
     * 
     * @param medicalItemsId 体检项目信息主键
     * @return 结果
     */
    @Override
    public int deleteYlMedicalItemsByMedicalItemsId(Long medicalItemsId)
    {
        return ylMedicalItemsMapper.deleteYlMedicalItemsByMedicalItemsId(medicalItemsId);
    }
}
